{
  "settings": {
    "hasHeaders": true,
    "constrainDragToContainer": true,
    "reorderEnabled": true,
    "selectionEnabled": false,
    "popoutWholeStack": false,
    "blockedPopoutsThrowError": true,
    "closePopoutsOnUnload": true,
    "showPopoutIcon": false,
    "showMaximiseIcon": false,
    "showCloseIcon": false,
    "responsiveMode": "onload",
    "tabOverlapAllowance": 0,
    "reorderOnTabMenuClick": true,
    "tabControlOffset": 10
  },
  "dimensions": {
    "borderWidth": 5,
    "borderGrabWidth": 15,
    "minItemHeight": 10,
    "minItemWidth": 10,
    "headerHeight": 20,
    "dragProxyWidth": 300,
    "dragProxyHeight": 200
  },
  "labels": {
    "close": "close",
    "maximise": "maximise",
    "minimise": "minimise",
    "popout": "open in new window",
    "popin": "pop in",
    "tabDropdown": "additional tabs"
  },
  "content": [
    {
      "type": "row",
      "isClosable": true,
      "reorderEnabled": true,
      "title": "",
      "content": [
        {
          "type": "stack",
          "width": 53.47912524850894,
          "isClosable": true,
          "reorderEnabled": true,
          "title": "",
          "activeItemIndex": 0,
          "content": [
            {
              "type": "component",
              "componentName": "codeEditor",
              "title": "hexagon.json",
              "componentState": {
                "code": [
                  "// Welcome to Cascade Studio!   Here are some useful functions:",
                  "//  Translate(), Rotate(), Scale(), Union(), Difference(), Intersection()",
                  "//  Box(), Sphere(), Cylinder(), Cone(), Text3D(), Polygon()",
                  "//  Offset(), Extrude(), RotatedExtrude(), Revolve(), Pipe(), Loft(), ",
                  "//  FilletEdges(), ChamferEdges(),",
                  "//  Slider(), Button(), Checkbox()",
                  "",
                  "// Don't forget to push imported or oc-defined shapes into sceneShapes to add them to the workspace!",
                  "",
                  "// sceneShapes.push(externalShapes['honeycomb.stl'])",
                  "",
                  "",
                  "// function to draw a wire of a hexagon",
                  "function Hexagon(size)",
                  "{ ",
                  "let sketchHexagon ",
                  "for(let i = 0 ; i <= 5 ; i += 1)",
                  "{",
                  "const angle = i * 2 * Math.PI / 6",
                  "const xvalue = size * Math.sin(angle);",
                  "const yvalue = size * Math.cos(angle);",
                  "const point = [xvalue,yvalue];",
                  "",
                  "    if (i === 0){",
                  "        sketchHexagon = new Sketch(point)",
                  "    }",
                  "    else {",
                  "        sketchHexagon.LineTo(point)",
                  "    }    ",
                  "}",
                  "return sketchHexagon.End(true)",
                  "}",
                  "",
                  "",
                  "// function to draw a walled hexagon",
                  "function WalledHexagon(size, wT)",
                  "{ ",
                  "let sketchWalledHexagon ",
                  "for(let outer = 0 ; outer <= 1 ; outer ++)",
                  "{",
                  "    for(let i = 0 ; i <= 6 ; i += 1)",
                  "    {",
                  "        const angle = i * 2 * Math.PI / 6",
                  "        const xvalue = size * Math.sin(angle);",
                  "        const yvalue = size * Math.cos(angle);",
                  "        const oxvalue = (size + wT) * Math.sin(angle);",
                  "        const oyvalue = (size + wT) * Math.cos(angle);",
                  "        const point = [xvalue,yvalue];",
                  "        // note the minus for the x-coordinate to make it",
                  "        // rotate in reverse! ",
                  "        const opoint = [-oxvalue, oyvalue];",
                  "",
                  "        if (i === 0)",
                  "        {",
                  "            if (outer === 0)",
                  "            {",
                  "            sketchWalledHexagon = new Sketch(point)",
                  "            }",
                  "            else ",
                  "            {",
                  "            sketchWalledHexagon.LineTo(opoint)",
                  "            }",
                  "        }",
                  "        else ",
                  "        {",
                  "            if (outer === 0)",
                  "            {",
                  "            sketchWalledHexagon.LineTo(point)",
                  "            }",
                  "            else",
                  "            {",
                  "            sketchWalledHexagon.LineTo(opoint)",
                  "            }",
                  "        }",
                  "    }    ",
                  "}",
                  "sketchWalledHexagon.LineTo([0,size])",
                  "return sketchWalledHexagon.End(false).Face()",
                  "}",
                  "",
                  "// dimensions of honeycomb, the cellSize is the inner radius of the inscribed circle",
                  "let cellSize = 4;",
                  "let wallThickness = 1;",
                  "// number of rows and columns of the honeycomb that is generated",
                  "// note that with large numbers the generation can take a long time! ",
                  "let rowNumber = 4;",
                  "let colNumber = 4;",
                  "",
                  "// create face from the hexagon sketch",
                  "let faceCell = (Hexagon(cellSize).Face())",
                  "",
                  "// create face from walled hexagon sketch",
                  "let facewalledHexagon = WalledHexagon(cellSize,wallThickness)",
                  "",
                  "",
                  "// create a wire from the sketch",
                  "function fwireCell(cellSize,wallThickness)",
                  "{",
                  "let wireCell = Translate([40,0,0],(Hexagon(cellSize).Wire()));",
                  "wireCell = wireCell + Translate([40,0,0],(Hexagon(cellSize + wallThickness).Wire()));",
                  "return wireCell",
                  "}",
                  "",
                  "fwireCell(cellSize,wallThickness)",
                  "",
                  "// construct a basic hexagonal column ",
                  "let HCell = Extrude(faceCell, [0,0,20]);",
                  "",
                  "",
                  "",
                  "let delta_x = 0.5 * ((Math.sqrt(3) * cellSize) + wallThickness)",
                  "let delta_y = (cellSize * 1.5)  + (wallThickness)",
                  "",
                  "// draw a box to subtract the hexagonal columns that are created below ",
                  "let boxSize = 1.6 * rowNumber * (cellSize + wallThickness);",
                  "let base = Box(boxSize, 0.866 * boxSize, 10); ",
                  "",
                  "",
                  "for (let colCount = 0 ;  colCount <= colNumber ; colCount += 1)",
                  "{",
                  "    for(let rowCount = 0 ; rowCount <= rowNumber; rowCount += 1)",
                  "        {",
                  "        let One = Translate([rowCount * 2 * delta_x, colCount * 2 * delta_y,0], HCell)       ;",
                  "        let Two = Translate([(1 + rowCount * 2) * delta_x, (1+ (colCount * 2)) * delta_y ,0], HCell);       ",
                  "        base = Difference( base , [One, Two] )",
                  "}",
                  "}",
                  "",
                  "",
                  "",
                  "Extrude(Translate([40,40,0],facewalledHexagon),[0,0,15])",
                  "Extrude(Translate([40 + (2 * delta_x) ,40,0],facewalledHexagon),[0,0,15])",
                  "Extrude(Translate([40 + delta_x ,40 + delta_y,0],facewalledHexagon),[0,0,15])",
                  "",
                  "",
                  "let walls1 = Translate([40,20,0],facewalledHexagon);",
                  "let walls2 = Translate([40 + (2 * delta_x) ,20,0],facewalledHexagon);",
                  "let walls3 = Union(walls1,walls2);",
                  "let walls4 = Translate([40 + delta_x ,20 + delta_y,0],facewalledHexagon);",
                  "let walls5 = Union(walls3,walls4);",
                  "let walls6 = Extrude(walls5,[0,0,35])",
                  "",
                  "",
                  "function HexagonHole(size)",
                  "{ ",
                  "let Bsketch ",
                  "for(let i = 0 ; i <= 5 ; i += 1)",
                  "{",
                  "const angle = i * 2 * Math.PI / 6",
                  "const xvalue = size * Math.sin(angle);",
                  "const yvalue = size * Math.cos(angle);",
                  "const point = [xvalue,yvalue];",
                  "",
                  "    if (i === 0){",
                  "        HHsketch = new Sketch(point)",
                  "    }",
                  "    else {",
                  "        HHsketch.LineTo(point)",
                  "    }    ",
                  "}",
                  "square = new Sketch([0,0])",
                  "square.LineTo([100,0]);",
                  "square.LineTo([100,100]);",
                  "square.LineTo([0,100]);",
                  "",
                  "return HHsketch.End(true).Face()",
                  "}",
                  "",
                  "",
                  ""
                ]
              },
              "width": 50,
              "isClosable": false,
              "reorderEnabled": true
            }
          ]
        },
        {
          "type": "column",
          "isClosable": true,
          "reorderEnabled": true,
          "title": "",
          "width": 46.52087475149106,
          "content": [
            {
              "type": "stack",
              "height": 80,
              "isClosable": true,
              "reorderEnabled": true,
              "title": "",
              "activeItemIndex": 0,
              "content": [
                {
                  "type": "component",
                  "componentName": "cascadeView",
                  "title": "CAD View",
                  "componentState": {
                    "componentName": "cascadeView",
                    "MeshRes": 0.1,
                    "MeshResRange": [
                      0.01,
                      2
                    ],
                    "Cache?": false,
                    "Radius": 30,
                    "RadiusRange": [
                      20,
                      40
                    ],
                    "Assembled": true,
                    "Dark pieces": true
                  },
                  "isClosable": false,
                  "reorderEnabled": true
                }
              ]
            },
            {
              "type": "stack",
              "height": 20,
              "isClosable": true,
              "reorderEnabled": true,
              "title": "",
              "activeItemIndex": 0,
              "content": [
                {
                  "type": "component",
                  "componentName": "console",
                  "title": "Console",
                  "componentState": {},
                  "height": 20,
                  "isClosable": false,
                  "reorderEnabled": true
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "isClosable": true,
  "reorderEnabled": true,
  "title": "",
  "openPopouts": [],
  "maximisedItemId": null
}